﻿using System;
using System.Threading.Tasks;

namespace Padsurface.CoreAudio.Wrappers.Model
{
    internal class AudioStreamInitializedState : IAudioStreamState
    {
        public Task Initialize(AudioStream context)
        {
            throw new InvalidOperationException();
        }

        public void Start(AudioStream context)
        {
            if (context == null) throw new ArgumentNullException("context");

            var capturingState = new AudioStreamCapturingState();
            capturingState.StartCapturing(context);

            context.SetState(capturingState);
        }

        public Task Stop(AudioStream context)
        {
            throw new InvalidOperationException();
        }
    }
}